package com.linovi.map

import scala.collection.mutable.HashMap

object Test {

  def main(args: Array[String]): Unit = {
    var test1: Map = new Map
    var test2 = new HashMap[String, String]

    var time1 = System.currentTimeMillis()
    for (i <- 1 to 100000) {
      test1.put("ezgi" + i, "abc")
    }
    var time2 = System.currentTimeMillis()
    println("Executed in " + (time2 - time1) + " milliseconds.")

    var time3 = System.currentTimeMillis()
    for (i <- 1 to 100000) {
      test2.put("ezgi" + i, "abc")
    }
    var time4 = System.currentTimeMillis()
    println("Executed in " + (time4 - time3) + " milliseconds with Scala's HashMap.")

    var time5 = System.currentTimeMillis()
    for (i <- 1 to 100000) {
      test1.remove("ezgi" + i)
    }
    var time6 = System.currentTimeMillis()
    println("Removed in " + (time6 - time5) + " milliseconds.")

    var time7 = System.currentTimeMillis()
    for (i <- 1 to 100000) {
      test2.remove("ezgi" + i)
    }
    var time8 = System.currentTimeMillis()
    println("Removed in " + (time8 - time7) + " milliseconds with Scala's HashMap.")
    
    var map = new Map
    map.put("e","h")
    map.put("e","hkn")
    
    println(map.get("e"))
    println(map.remove("e"))

  }
}